create  table jms_dm.dm_end_sender_report_detail_dt 
(
input_time                                              timestamp COMMENT '订单录入时间' ,
waybill_id                                              varchar(100) COMMENT '运单号' ,
order_source_code                                       varchar(100) COMMENT '订单来源code' ,
order_source_name                                       varchar(100) COMMENT '订单来源名称' ,
order_status_code                                       varchar(100) COMMENT '订单状态code' ,
real_pick_network_code                                  varchar(100) COMMENT '实际取件网点code' ,
real_pick_network_name                                  varchar(100) COMMENT '实际取件网点名称' ,
pick_time                                               timestamp COMMENT '取件时间' ,
best_pick_time_end                                      varchar(100) COMMENT '最佳取件结束时间' ,
cancel_time                                             timestamp COMMENT '订单取消时间' ,
on_code varchar(100) COMMENT '订单取消原因编号' ,
on varchar(100) COMMENT '取消订单原因' ,
business_name                     varchar(100) COMMENT '品牌' ,
post_site_code                                          varchar(100) COMMENT '门店编码' ,
post_site_name                    varchar(100) COMMENT '门店name' ,
post_site_address                                       varchar(100) COMMENT '门店地址' ,
customer_code                                           varchar(100) COMMENT '客户编号code' ,
customer_name                                           varchar(100) COMMENT '客户编号名称' ,
pick_regional_code           varchar(100) COMMENT '取件_大区code' ,
pick_regional_name           varchar(100) COMMENT '取件_大区name' ,
pick_agent_code              varchar(100) COMMENT '取件_代理区编码' ,
pick_agent_name              varchar(100) COMMENT '取件_代理区名称' ,
pick_fran_code               varchar(100) COMMENT '取件_加盟商' ,
pick_fran_name               varchar(100) COMMENT '取件_加盟商' ,
pick_network_code                                       varchar(100) COMMENT '取件网点code' ,
pick_network_name                                       varchar(100) COMMENT '取件网点名称' ,
sender_province_id                                      varchar(100) COMMENT '寄件省份id' ,
sender_province_name                                    varchar(100) COMMENT '寄件省份' ,
sender_city_id                                          varchar(100) COMMENT '寄件城市id' ,
sender_city_name                                        varchar(100) COMMENT '寄件城市' ,
sender_area_id                                          varchar(100) COMMENT '寄件区域id' ,
sender_area_name                                        varchar(100) COMMENT '寄件区域' ,
sender_detailed_address                                 varchar(100) COMMENT '寄件详细地址' ,
receiver_province_id                                    varchar(100) COMMENT '收件省份id' ,
receiver_province_name                                  varchar(100) COMMENT '收件省份' ,
receiver_city_id                                        varchar(100) COMMENT '收件城市id' ,
receiver_city_name                                      varchar(100) COMMENT '收件城市' ,
receiver_area_id                                        varchar(100) COMMENT '收件区域id' ,
receiver_area_name                                      varchar(100) COMMENT '收件区域' ,
receiver_detailed_address                               varchar(100) COMMENT '收件详细地址' ,
category_id varchar(100) COMMENT '' ,
date_time                                               timestamp COMMENT '分区' ,
dt                                                      varchar(100) COMMENT '分区' )
ENGINE=OLAP
DUPLICATE KEY(填写key)
comment 'insert overwrite table jms_dm.dm_end_sender_report_detail_dt partition(dt)'
PARTITION BY RANGE (date_time) ( 
   START ("2023-11-04") END ("2024-01-03") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(site_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);